/*********************************************************************
*                SEGGER Microcontroller GmbH & Co. KG                *
*        Solutions for real time microcontroller applications        *
**********************************************************************
*                                                                    *
*        (c) 1996 - 2017  SEGGER Microcontroller GmbH & Co. KG       *
*                                                                    *
*        Internet: www.segger.com    Support:  support@segger.com    *
*                                                                    *
**********************************************************************

** emWin V5.46 - Graphical user interface for embedded applications **
emWin is protected by international copyright laws.   Knowledge of the
source code may not be used to write a similar product.  This file may
only  be used  in accordance  with  a license  and should  not be  re-
distributed in any way. We appreciate your understanding and fairness.
----------------------------------------------------------------------
File        : 2DGL_DrawGIF.c
Purpose     : Shows how to render GIF images
Requirements: WindowManager - ( )
              MemoryDevices - ( )
              AntiAliasing  - ( )
              VNC-Server    - ( )
              PNG-Library   - ( )
              TrueTypeFonts - ( )
----------------------------------------------------------------------
*/

#include "GUI.h"

/*********************************************************************
*
*       Defines
*
**********************************************************************
*/
//
// Recommended memory to run the sample with adequate performance
//
#define RECOMMENDED_MEMORY (1024L * 20)

/*******************************************************************
*
*       Static data
*
********************************************************************
*/
static unsigned const char _acImage0[] = {
  0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x30, 0x00, 0x30, 0x00, 0xF3, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFB, 0xF3, 0x05, 0xFF, 0x64, 0x03, 0xDD, 0x09, 0x07, 0xF2, 0x08, 0x84, 0x47, 0x00, 0xA5, 0x00, 0x00, 0xD3, 0x02, 0xAB, 0xEA, 0x1F, 0xB7, 0x14,
  0x00, 0x64, 0x12, 0x56, 0x2C, 0x05, 0x90, 0x71, 0x3A, 0xBF, 0xBF, 0xBF, 0x80, 0x80, 0x80, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x21, 0xFF, 0x0B, 0x4E, 0x45, 0x54, 0x53, 0x43, 0x41, 0x50, 0x45, 0x32, 0x2E, 0x30, 0x03, 0x01, 0x00, 0x00, 0x00,
  0x21, 0xFE, 0x30, 0x54, 0x68, 0x69, 0x73, 0x20, 0x47, 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AB, 0xE5, 0x6F, 0xB0, 0xBC, 0x22, 0xF0, 0x4F, 0xF2, 0xEF, 0xF4, 0x46, 0x41, 0xC0, 0xF1, 0xF9, 0x4D, 0xEE, 0xD1, 0x0A,
  0x52, 0xE7, 0x1E, 0x10, 0x82, 0x68, 0xDA, 0xB1, 0x39, 0x88, 0xD0, 0xDE, 0x98, 0x86, 0x10, 0x23, 0x4A, 0x84, 0x18, 0x01, 0x00, 0x21, 0xFE, 0x38, 0x46, 0x49, 0x4C, 0x45, 0x20, 0x49, 0x44, 0x45, 0x4E, 0x54, 0x49, 0x54, 0x59, 0x0D, 0x0A,
  0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x6F, 0x72, 0x20, 0x6D, 0x6F, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x62, 0x79, 0x0D, 0x0A,
  0x53, 0x79, 0x72, 0x75, 0x73, 0x73, 0x20, 0x4D, 0x63, 0x44, 0x61, 0x6E, 0x69, 0x65, 0x6C, 0x0D, 0x0A,
  0x00, 0x21, 0xFF, 0x0B, 0x47, 0x49, 0x46, 0x43, 0x4F, 0x4E, 0x6E, 0x62, 0x31, 0x2E, 0x30, 0x02, 0x06, 0x00, 0x0E, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0E, 0x01, 0x00, 0x02, 0x00,
  0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0E, 0x01, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0E, 0x01, 0x00, 0x02, 0x00, 0x0A,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0E, 0x01, 0x00, 0x02, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0E, 0x01, 0x00, 0x02, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x3B, 0x00
};

/*******************************************************************
*
*       Static functions
*
********************************************************************
*/
/*******************************************************************
*
*       _ShowMovie
*
* Function description
*   Shows the contents of a GIF file as movie
*/
static void _ShowMovie(const char * pFile, int FileSize) {
  GUI_GIF_IMAGE_INFO ImageInfo = {0}; // Info structure of one particular GIF image of the GIF file
  GUI_GIF_INFO       GifInfo   = {0}; // Info structure of GIF file
  int                i;
  int                j;
  int                XPos;
  int                YPos;

  //
  // Display sample information
  //
  GUI_SetFont(&GUI_Font8x16);
  GUI_ClearRect(0, 40, 319, 59);
  GUI_DispStringHCenterAt("Show complete GIF file as movie", 160, 40);
  //
  // Show movie
  //
  GUI_ClearRect(0, 60, 319, 239);                                 // Clear the image area
  GUI_GIF_GetInfo(pFile, FileSize, &GifInfo);                     // Get GIF info structure
  XPos = (GifInfo.xSize > 320) ?  0 : 160 - (GifInfo.xSize / 2);
  YPos = (GifInfo.ySize > 180) ? 60 : 150 - (GifInfo.ySize / 2);
  for (i = 0; i < 2; i++) {                                       // Show the complete GIF 2 times ...
    for (j = 0; j < GifInfo.NumImages; j++) {
      GUI_GIF_DrawSub(pFile, FileSize, XPos, YPos, j);            // Draw sub image
      GUI_GIF_GetImageInfo(pFile, FileSize, &ImageInfo, j);       // Get sub image information
      GUI_Delay(ImageInfo.Delay ? ImageInfo.Delay * 10 : 100);    // Use the Delay member of the ImageInfo structure for waiting a while
    }
    GUI_Delay(2000);                                              // Wait a while
  }
}

/*******************************************************************
*
*       _ShowSubImages
*
* Function description
*   Shows all sub images of a GIF file side by side
*/
static void _ShowSubImages(const char * pFile, int FileSize) {
  GUI_GIF_INFO       GifInfo   = {0}; // Info structure of GIF file
  int                j;
  int                XPos;
  int                YPos;
  //
  // Display sample information
  //
  GUI_SetFont(&GUI_Font8x16);
  GUI_ClearRect(0, 40, 319, 59);
  GUI_DispStringHCenterAt("Show all sub images of a GIF file", 160, 40);
  //
  // Show sub images
  //
  GUI_ClearRect(0, 60, 319, 239);                                 // Clear the image area
  GUI_GIF_GetInfo(pFile, FileSize, &GifInfo);                     // Get GIF info structure
  XPos = 160 - GifInfo.xSize * GifInfo.NumImages / 2;
  YPos = (GifInfo.ySize > 180) ? 60 : 150 - (GifInfo.ySize / 2);
  for (j = 0; j < GifInfo.NumImages; j++) {
    char acNumber[3] = "#";
    acNumber[1] = '0' + j;
    GUI_DispStringHCenterAt(acNumber, XPos + GifInfo.xSize / 2, 90);
    GUI_GIF_DrawSub(pFile, FileSize, XPos, YPos, j);              // Draw sub image
    XPos += GifInfo.xSize;
  }
  GUI_Delay(4000);                                                // Wait a while
}

/*******************************************************************
*
*       _ShowComments
*
* Function description
*   Shows all comments of a GIF file
*/
static void _ShowComments(const char * pFile, int FileSize) {
  GUI_RECT Rect          = {80, 100, 239, 199};
  char     acBuffer[256] = {0};
  int      CommentCnt;

  //
  // Display sample information
  //
  GUI_SetFont(&GUI_Font8x16);
  GUI_ClearRect(0, 40, 319, 59);
  GUI_DispStringHCenterAt("Show all comments of a GIF file", 160, 40);
  //
  // Show all comments
  //
  GUI_ClearRect(0, 60, 319, 239);                                 // Clear the image area
  CommentCnt = 0;
  while (!GUI_GIF_GetComment(pFile, FileSize, (unsigned char *)acBuffer, sizeof(acBuffer), CommentCnt)) {
    char acNumber[12] = "Comment #0:";
    acNumber[9] = '0' + CommentCnt;
    GUI_DispStringHCenterAt(acNumber, 160, 80);
    GUI_SetBkColor(GUI_BLACK);
    GUI_SetColor(GUI_WHITE);
    GUI_ClearRectEx(&Rect);
    GUI_DispStringInRectWrap(acBuffer, &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER, GUI_WRAPMODE_WORD);
    GUI_SetBkColor(GUI_WHITE);
    GUI_SetColor(GUI_BLACK);
    GUI_Delay(4000);                                              // Wait a while
    CommentCnt++;
  }
}

/*******************************************************************
*
*       Public code
*
********************************************************************
*/
/*******************************************************************
*
*       MainTask
*/
void MainTask(void) {
  GUI_Init();
  //
  // Check if recommended memory for the sample is available
  //
  if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
    GUI_ErrorOut("Not enough memory available."); 
    return;
  }
  GUI_SetBkColor(GUI_WHITE);
  GUI_Clear();
  GUI_SetColor(GUI_BLACK);
  GUI_SetFont(&GUI_Font24_ASCII);
  GUI_DispStringHCenterAt("DrawGIF - Sample", 160, 5);
  while (1) {
    _ShowMovie    ((char *)_acImage0, sizeof(_acImage0));
    _ShowSubImages((char *)_acImage0, sizeof(_acImage0));
    _ShowComments ((char *)_acImage0, sizeof(_acImage0));
  }
}

/*************************** End of file ****************************/

